package com.jr.serviceimpl;

import com.jr.dao.WhiteListDao;
import com.jr.daoimpl.WhiteListDaoImpl;
import com.jr.entity.Enterprise;
import com.jr.pojo.WeQuery;
import com.jr.pojo.WhiteEnterprise;
import com.jr.service.WhiterListService;
import util.PageHelper;

import java.util.ArrayList;

public class WhiteListServiceImpl implements WhiterListService {

    WhiteListDao whiteListDao = new WhiteListDaoImpl();

    @Override
    public int countTotalData(WeQuery weQuery,int enterprise_id) {
        return whiteListDao.countTotalData(weQuery,enterprise_id);
    }


    @Override
    public ArrayList<WhiteEnterprise> findIndexPageData(PageHelper pageHelper, WeQuery weQuery,int enterprise_id) {
        return whiteListDao.selectIndexPageData(pageHelper,weQuery,enterprise_id);
    }


    @Override
    public ArrayList selectWhiteSupName(int eid) {
        return whiteListDao.selectWhiteSupName(eid);
    }


    @Override
    public Enterprise selectCodeByName(String enamess) {
        return whiteListDao.selectCodeByName(enamess);
    }


    @Override
    public boolean addSup(int enterprise_id, int supplier_id, String supplier_level, String update_date) {
        return whiteListDao.addSup(enterprise_id,supplier_id,supplier_level,update_date)>0;
    }


    @Override
    public boolean delSup(int enterprise_id, int supplier_id) {
        return whiteListDao.delSup(enterprise_id,supplier_id)>0;
    }
}
